<?php

/*
 *
 *
 * This software has been made FREELY available by author for interest of the developers. 
 *      I hope this will help you in coding faster and robust php application
 *            You can modify and use it as you it suits you.
 *              Your comments, suggestions and corrections 
 *                          will be highly 
 *                           APPRECIATED. 
 *                                      Thanks, 
 *                                      Author
 * @author :   Roshan Budhathoki (contact@roshanbudhathoki.com);
 * @URL    :   <http://www.roshanbudhathoki.com>
 *
 */

class DB {
	static $instance;
	public $con;
	
	public static function newInstance() {
		if (! self::$instance instanceof self) {
			self::$instance = new self ();
		}
		return self::$instance;
	}
	
	public function __construct() {
		
		$options = array (PDO::ATTR_PERSISTENT => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::FETCH_ASSOC => PDO::FETCH_ASSOC );
		$params = array ('host' => DB_SERVER, 'username' => DB_USER, 'password' => DB_PASSWORD, 'dbname' => DB_DATABASE, 'options' => $options );
		$this->con = Zend_Db::factory ( 'PDO_MYSQL', $params );
	}
	
	

}